<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<#if film??>
<title>Download YouTube MP3 ${film.title}</title>
<meta name="description"
	content="Download YouTube MP3 ${film.title} by Free Online MP3 converter" />
<#else>
<title>Free Online YouTube to MP3 Converter for Win and Mac-ShareYouTubeMP3</title>
<meta name="description" content="Free Online YouTube to MP3 for Win and Mac, no register or download. Get and share high quality mp3 songs from YouTube now." />
</#if>
<meta name="keywords" content="YouTube to MP3, convert YouTube to MP3, YouTube to MP3 Converter, YouTube to MP3 Mac" />
<meta name="google-site-verification" content="OYhHl0v9I2D1zOkp2UOcEMSbeReYbOY43k2jU7DAMjk" />
<link href="${cssRoot}/global.css" rel="stylesheet" type="text/css" />
<link href="${cssRoot}/ui/jquery-ui-1.8.17.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${jsRoot}/google.js"></script>
<script type="text/javascript">
	var isProcessing = false;
</script>
<#if film??>
<script type="text/javascript">
function isJreInstalled() {
	if(navigator.userAgent.indexOf('MSIE') > -1) {
		try {
			new ActiveXObject('JavaWebStart.isInstalled');
			return true;
		} catch(e) {
			return false;
		}
	}
	
	var b = navigator.mimeTypes 
	 	&& navigator.mimeTypes.length 
	 	&& (navigator.mimeTypes['application/x-java-jnlp-file'] != null 
	 			|| navigator.mimeTypes['application/x-java-vm'] != null);
	
	var c = navigator.javaEnabled();
	if (c == false) {
		return c;
	} 

	return b;
}

function convert(format) {
	document.getElementById('convertMsg').style.display = 'block';
	document.getElementById('btnDownload').style.display = 'none';
	
	if (isJreInstalled()) {
		document.getElementById('convertMsg').innerHTML = 'Loading applet...';
			
		var html = '<applet name="YouTube Mp3/AAC Converter" code="com.wontube.Convert2Mp3Applet.class" archive="${request.contextPath}/applet/yt-mp3-converter-1.0.0.jar" height="0" width="0" align="center" MAYSCRIPT><param name="format" value="'
			+ format + '" />'
			+ '<param name="url" value="${film.itemUrl}"/><apram name="ua" value="${userAgent}" /></applet>';
		document.getElementById('applet').innerHTML = html;
		
		return true;
	} 

	var html = '<div style="font-size:12pt;">It appears you do not have Java installed or it is disabled on your system. '
			+ 'You can get Java <a style="font-size:12pt;color:blue" href="http://www.java.com/getjava/" class="link" target="_blank">here</a>.</div>';
	
	document.getElementById('convertMsg').innerHTML = html;
	return false;
};

function convert2MP3() {
	if (convert('mp3')) {
		_gaq.push(['_trackEvent', 'MP3', 'Download', document.location.pathname]);
	}
};

function convert2AAC() {
	if (convert('aac')) {
		_gaq.push(['_trackEvent', 'AAC', 'Download', document.location.pathname]);
	}
};

</script>
</#if>
</head>
<body>
<input type="hidden" id="contextPath" value="${request.contextPath}" />
<#include "/i18n/${locale}/head.ftl">
<div id="main">
  <#if film??>
  <#else>
  	<div id="textbox" class="textbox">
    <h1>Free YouTube to MP3</h1>
    <p <#if locale='pa_PK'>style="direction: rtl;"</#if> class="dd"><a href="${request.contextPath}">ShareYouTubeMP3.com</a> ${i18n("introduce")}</p>
  </div>
  </#if>
  <!-- textbox end -->
  <div id="conbox" class="conbox">
    <div id="mydiv1">
	    <#if film??>
	    <#else>
	    	<div class="top_conner"> <span class="l_c"></span> <span class="r_c"></span> </div>
	    <div class="cenbox">
	      <p class="tit">${i18n("txtUrl_prompt")}</p>
	      <div class="lable">
	        <input id="txtUrl" type="text" style="color:#bbbbbb" value="lady gaga" />
	      </div>
	      <p class="tit2" id="result"></p>
	      <div class="btn_converter">
	        <input id="btnConvert" type="button" onclick="parseMp3();" />
	      </div>
	      <div class="sharebox"> <span class="lbg"></span>
	        <div class="nrk"> <span class="bt">${i18n("spread")}</span>
	          <div class="bg">
	            <div id="fb-root"></div>
	            <script type="text/javascript">
				     var addthis_config = {
				        data_ga_property: 'UA-27516886-1'
				     };
					 
					 (function(d, s, id) {
						  var js, fjs = d.getElementsByTagName(s)[0];
						  if (d.getElementById(id)) return;
						  js = d.createElement(s); js.id = id;
						  js.src = "//connect.facebook.net/zh_CN/all.js#xfbml=1";
						  fjs.parentNode.insertBefore(js, fjs);
					}(document, 'script', 'facebook-jssdk'));
				</script>
	            <div class="fb-like" style="float:left;" data-href="http://www.facebook.com/ShareYouTubeMP3" data-send="false" data-layout="button_count" data-width="90" data-show-faces="true"></div>
	            <!-- AddThis Button BEGIN -->
	            <script type="text/javascript">
					var addthis_config = {
					     pubid: "ra-4edc321f02b434d3"
					}
				</script>
	            <div class="addthis_toolbox addthis_default_style " style="float:left;">
	              <div class="addthis_toolbox" addthis:url="#" addthis:title="Free Online YouTube to MP3"> <a class="addthis_button_tweet"></a> <a class="addthis_button_google_plusone" g:plusone:size="medium"></a> </div>
	              <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4edc321f02b434d3"></script>
	            </div>
	            <!-- AddThis Button END -->
	          </div>
	        </div>
	        <span class="rbg"></span> </div>	        
	        <div class="addon_ins"><a href="http://www.wontube.com/?utm_source=referral&utm_medium=textlink&utm_campaign= mp3wontube">${i18n("getFreeMp3")}</a></div>
			<div class="addon_ins"><a href="http://www.wontube.com/free-youtube-downloader.html">Free YouTube Downloader for Android</a></div>
			<div class="addon_ins">			
			<a href="http://free.wondershare.com/free-video-converter.html?utm_source=referral&utm_medium=textlink&utm_campaign=mp3vc">Download Free Video Converter for Windows>></a>
	  		<div class="addon_ins"><a href="http://www.wondershare.com/pro/video-converter-ultimate.html?utm_source=shareyoutubemp3&utm_medium=textlink&utm_campaign=shareyoutubemp3">Get All-in-one Video Converter to convert DVD and videos to virtually any format, burn and rip DVD, remove DRM.</a></div>
	    </div>
	    <div class="btm_conner"> <span class="l_c"></span> <span class="r_c"></span> </div>
	    </#if>
    </div>
    <!-- mydiv1 end -->
    <div id="mydiv2">
    	<#if film??>
    		<div class="top_conner"> <span class="l_c"></span> <span class="r_c"></span> </div>
			<div class="cenbox">	
			   	<#if errorMsg??>
			   	<p class="tit3" id="lblResult">${errorMsg}</p>
    			<#else>
    			<p class="tit3" id="lblResult">${film.title}</p>
    			<div id="convertMsg" class="tit4" style="display:none"></div>
	    		<div id="btnDownload" class="btn_download">
	    			<a class="down_mp3" href="javascript:;" onclick="convert2MP3();"></a>
	    			<a class="down_aac" href="javascript:;" onclick="convert2AAC();"></a>
	    		</div>
				<div id="applet">
	    		</div>
	    		<div class="share"> 
	    			<span class="z">${i18n("share")}</span>
		        	<div class="k">
			        	<!-- AddThis Button BEGIN -->
			        	<script type="text/javascript">
			        		var addthis_config = {
			        			data_ga_property: 'UA-27516886-1'
			     			};
			     		</script>
			        	<div class="addthis_toolbox addthis_default_style addthis_32x32_style"> <a class="addthis_button_facebook">&nbsp;&nbsp;&nbsp;</a> <a class="addthis_button_twitter">&nbsp;&nbsp;&nbsp;</a> <a class="addthis_button_gmail">&nbsp;&nbsp;&nbsp;</a> 
			        	</div>
			        	<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4edc321f02b434d3"></script>
			        	<!-- AddThis Button END -->
		        	</div>
		        </div>
		        </#if>
	    		<div class="sharebox2"> <span class="lbg"></span>
		        	<div class="nrk"> <span class="bt">${i18n("txtUrl_prompt")}</span>
		        		<div> <span class="srk">
		            		<input id="txtUrl" type="text" style="color:#bbbbbb" value="lady gaga"  />
		            		</span><span class="btn"><input id="btnConvert" type="button" onclick="parseMp3();" /></span> 
		            	</div>
		        	</div>
		        	<span class="rbg"></span> 
		        </div>
	        	<p class="tit2" id="result"></p>	        	
	        	<div class="addon_ins"><a href="http://www.wontube.com/?utm_source=referral&utm_medium=textlink&utm_campaign=convertwontube">Get More Free MP3 and Videos</a></div>
				<div class="addon_ins"><a href="http://www.wontube.com/free-youtube-downloader.html">Free YouTube Downloader for Android</a></div>
				<div class="addon_ins"><a href="http://www.wontube.com/free-video-converter.html?utm_source=referral&utm_medium=textlink&utm_campaign=convertvc">${i18n("downForWidOrMac")} &gt;&gt;</a></div>
		    </div>
	        <div class="btm_conner2"> <span class="l_c"></span> <span class="r_c"></span></div>
    	</#if>
    </div>
    <!-- mydiv2 end -->
  </div>
  <div class="probox">
    <#include "/include/popular.ftl">
  </div>
  <div class="sidebar">
    <#include "/include/social.html">
  </div>
</div>
<!-- main end -->
<#include "/include/footer.ftl">
<script type="text/javascript" src="${jsRoot}/utils.js"></script>
<script type="text/javascript" src="${jsRoot}/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="${jsRoot}/js.js"></script>
<script type="text/javascript" src="${jsRoot}/ui/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="${jsRoot}/prompt.js"></script>
<script type="text/javascript" src="${jsRoot}/search.js"></script>

<script type="text/javascript">
var input_prompt = 'lady gaga';
var normal_color = "#666666";
var prompt_color = "#bbbbbb";
var originalTitle = document.title;

function resetProcessing() {
	isProcessing = false;
}

function showMsg(msg) {
	$('#convertMsg').html(msg);
};

function showProgress(percent) {
	var p = Number(percent);
	isProcessing = (p < 100);
	var msg = 'Downloading... ' + p.toFixed(2) + '%';
	showMsg(msg);
	
	document.title = p.toFixed(2) + '% ' + originalTitle;
};

function showDownload() {
	resetProcessing();
	$('#convertMsg').hide();
	$('#btnDownload').show();
};

function showResult(path) {
	var html = '<a path="' + path + '" href="javascript:;" onclick="openConvertPath(this);">Open download path</a>';
	$('#convertMsg').html(html);
	resetProcessing();
};

function openConvertPath(ele) {
	var path = $(ele).attr('path');
	var html = '<applet name="YouTube Mp3/AAC Converter" code="com.wontube.Convert2Mp3Applet.class" archive="${request.contextPath}/applet/yt-mp3-converter-1.0.0.jar" height="0" width="0" align="center" MAYSCRIPT><param name="path" value="'
		+ path + '"/></applet>';

	$('#applet').html(html);
};

$(window).load(function () {
	$(window).bind('beforeunload', function() { 
		if (isProcessing) {
			return "There are still downloading jobs in progress.\r\nAre you sure you want to cancel them?";
		}
	});
});

$(document).ready(function() {
	$("#.menu > ul > li").currentMenu({ text: '${i18n("home")}', style: "curr" });
	initPrompt();
	
	var txtUrl = $('#txtUrl');
	txtUrl.val(input_prompt);
	txtUrl.focus(function() {
		this.select();
		if (this.value == input_prompt) {
			this.value = '';
			$(this).css("color", normal_color);
		}
	});

	txtUrl.blur(function() {
		if (this.value == '') {
			this.value = input_prompt;
			$(this).css("color", prompt_color);
		}
	});

	txtUrl.keyup(function(event) {
		if (event.which === 13) {
			parseMp3();
		} else {
			var txt = $(this).val().trim();
    		if (txt == input_prompt) {
    			$(this).css("color", prompt_color);
    		} else {
    			$(this).css("color", normal_color);
    		}
		}
	});
});
</script>
<!--[if lt IE 7]>
<script type="text/javascript" src="js/iepng.js"></script>
<script type="text/javascript">
EvPNG.fix('div, ul, img, li, input, a, table, td, th, ol, dl, dt, dd, h1, h2, h3, h4, h5, h6, span');
</script>
<![endif]-->
</body>
</html>
